#include<bits/stdc++.h>
using namespace std;
map<string , int>mp;
int main(){
	int  n;
	cin >> n;
	string a[105];
	for(int i = 1 ; i <= n ; i++){
		string x;
		cin >> x;
		for(int j = 0 ; j < x.length() ; j++){
			x[j] = tolower(x[j]);
		}
		a[i] = x;
		mp[a[i]]++;
	}
	int ndmax = 0;
	string stmax;
	for(int i = 1 ; i <= n ; i++){
		if(mp[a[i]] > ndmax){
			ndmax = mp[a[i]];
			stmax = a[i];
		}
	}
	cout << stmax << endl;
	return 0;
}
